home *** CD-ROM | disk | FTP | other *** search
/ .net - The Best of 1999/2000 / netCD Special01.iso / pc / Software / Dreamweaver / dreamw.exe / data1.cab / App_Files / Configuration / Objects / Head / Link.js < prev    next >
Encoding:
JavaScript  |  1999-12-09  |  1.2 KB  |  46 lines

  1. // Copyright 1999 Macromedia, Inc. All rights reserved.
  2.  
  3.  
  4. //---------------   GLOBAL VARIABLES   ---------------
  5.  
  6. var helpDoc = MM.HELP_objLink;
  7.  
  8. //---------------     API FUNCTIONS    ---------------
  9.  
  10. function objectTag(){
  11.   var Attributes='';
  12.   var Form=document.forms[0];
  13.   var href=Form.href.value;
  14.   var id=Form.id.value;
  15.   var rel=Form.rel.value;
  16.   var rev=Form.rev.value;
  17.   var title=Form.title.value;
  18.   
  19.   if (href!='')
  20.     Attributes+='href="' + href + '" ';
  21.   if (id!='')
  22.     Attributes+='id="' + id + '" ';
  23.   if (rel!=''){
  24.     Attributes+='rel="' + rel + '" ';
  25.     if (rel.toLowerCase().indexOf("stylesheet")!=-1)
  26.       Attributes+='type="text/css" ';
  27.   }    
  28.   if (rev!='')
  29.     Attributes+='rev="' + rev + '" ';
  30.   if (title!='')
  31.     Attributes+='title="' + title + '" ';
  32.  
  33.   if (Attributes.charAt(Attributes.length-1)==' ') { //if there is an extra space
  34.     Attributes = Attributes.substring(0,Attributes.length-2) //kill it
  35.   }
  36.  
  37.   return '<link ' + Attributes + '>';
  38. }
  39.  
  40. //---------------    LOCAL FUNCTIONS   ---------------
  41.  
  42. function browseForFile(){
  43.   var fileName=browseForFileURL();
  44.   document.forms[0].href.value=fileName;
  45. }
  46.